<?php
class Comment extends CI_Model {
	function __construct() {
		parent::__construct ();
	}
	function addComment($id_User, $id_Obj, $content) {
		$data = array ('id_User' => $id_User, 'id_Obj' => $id_Obj, 'content' => $content );
		$this->db->insert ( 'comment', $data );
		return $this->db->insert_id ();
	}
	function getComment($id) {
		$this->db->select ( "*" );
		$this->db->from ( "comment" );
		$this->db->where ( "id_Obj", $id );
		$query = $this->db->get ();
		if ($query->num_rows () >= 1) {
			return $query->result ();
		} else
			return FALSE;
	
	}
}